----------------------------------
--      Module Declaration      --
----------------------------------

local boss = BB["Hadronox"]
local mod = BigWigs:New(boss, tonumber(("$Revision: 543 $"):sub(12, -3)))
if not mod then return end
mod.partycontent = true
mod.otherMenu = "Dragonblight"
mod.zonename = BZ["Azjol-Nerub"]
mod.enabletrigger = boss
mod.guid = 28921
mod.toggleoptions = {"leechpoison", "acidcloud", "bosskill"}

----------------------------------
--         Localization         --
----------------------------------

local L = AceLibrary("AceLocale-2.2"):new("BigWigs"..boss)

L:RegisterTranslations("enUS", function() return {
	acidcloud = "Acid Cloud",
	acidcloud_desc = "Warn when Hadronox casts Acid Cloud.",
	cmd = "Hadronox",
	leechpoison = "Leech Poison",
	leechpoison_desc = "Warn when Hadronox casts Leech Poison.",
}

end )

L:RegisterTranslations("deDE", function() return {
	acidcloud = "Säurewolke",
	acidcloud_desc = "Warnung wenn Hadronox die Säurewolke zaubert.",
	cmd = "Hadronox",
	leechpoison = "Egelgift",
	leechpoison_desc = "Warnung wenn Hadronox das Egelgift zaubert.",
}

end )

L:RegisterTranslations("esES", function() return {
}

end )

L:RegisterTranslations("esMX", function() return {
}

end )

L:RegisterTranslations("frFR", function() return {
	acidcloud = "Nuage d'acide",
	acidcloud_desc = "Prévient quand Hadronox incante un Nuage d'acide.",
	cmd = "Hadronox",
	leechpoison = "Poison de sangsue",
	leechpoison_desc = "Prévient quand Hadronox incante un Poison de sangsue.",
}

end )

L:RegisterTranslations("koKR", function() return {
	acidcloud = "독 구름",
	acidcloud_desc = "하드로녹스의 독 구름 시전을 알립니다.",
	cmd = "하드로녹스",
	leechpoison = "착취의 독",
	leechpoison_desc = "하드로녹스의 착취의 독 시전을 알립니다.",
}

end )

L:RegisterTranslations("ruRU", function() return {
	acidcloud = "Яд пиявки",
	acidcloud_desc = "Предупреждать о применении Хадроноксом Яда пиявки.",
	cmd = "Хадронокс",
	leechpoison = "Едкое облако",
	leechpoison_desc = "Предупреждать о применении Хадроноксом Едкого облака.",
}

end )

L:RegisterTranslations("zhCN", function() return {
	acidcloud = "酸性之云",
	acidcloud_desc = "当哈多诺克斯施放酸性之云时发出警报。",
	leechpoison = "吸血毒药",
	leechpoison_desc = "当哈多诺克斯施放吸血毒药时发出警报。",
}

end )

L:RegisterTranslations("zhTW", function() return {
	acidcloud = "酸性之雲",
	acidcloud_desc = "當哈卓諾克斯施放酸性之雲時發出警報。",
	cmd = "哈卓諾克斯",
	leechpoison = "吸血毒液",
	leechpoison_desc = "當哈卓諾克斯施放吸血毒液時發出警報。",
}

end )

----------------------------------
--        Initialization        --
----------------------------------

function mod:OnEnable()
	-- Handles both Leech Poison and Acid Cloud
	self:AddCombatListener("SPELL_CAST_SUCCESS", "Spell", 53400, 59419, 53030, 59417)
	self:AddCombatListener("UNIT_DIED", "BossDeath")
end

----------------------------------
--        Event Handlers        --
----------------------------------

function mod:Spell(_, spellId, _, _, spellName)
	if self.db.profile.acidcloud or self.db.profile.leechpoison then
		self:IfMessage(spellName, "Attention", spellId)
	end
end
